<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>CreateMovie</title>
<script type="text/javascript">

function validate(){
    
    if(document.frm.movieName.value=="")
    {
 alert("Please enter movie name");
 document.frm.movieName.focus();
 return false;
    }
    if(document.frm.movieBanner.value=="")
    {
 alert("Please enter movie banner");
 document.frm.movieBanner.focus();
 return false;
    }
    if(document.frm.releaseDate.value=="")
    {
 alert("Please enter release date");
 document.frm.releaseDate.focus();
 return false;
    }
    if(document.frm.rentAmount.value=="")
    {
 alert("Please enter rent amount");
 document.frm.rentAmount.focus();
 return false;
    }
   
    if(document.frm.categories.value=="")
    {
 alert("Please select a category");
 document.frm.categories.focus();
 return false;
    }
    
    	 
    if(document.frm.state.value=="")
   {
 alert("Please enter state");
 document.frm.state.focus();
 return false;
    }
    if(document.frm.copiesAvailable.value=="")
    {
 alert("Please enter copiesAvailable");
 document.frm.city.focus();
 return false;
    }
   
    return true;
}
    </script>


</head>
<body>
<table width="100%">
<%@ include file="/header.jsp" %>

<tr valign="top"><td align="center" height="300px">
<table width="100%">

<tr valign="top" height="50px">
<td align="center">
<%@ include file="/headerLinks.jsp" %>
</td>
</tr>
<tr><td align="center" height="40px" colspan="2" valign="top"><h3>Create Movie</h3></td></tr>
<% if(request.getAttribute("message") != null) { %>
<tr><td align="center" style="color:red"><%= request.getAttribute("message") %></td></tr>
<% } %>


<FORM NAME="frm" METHOD="post" action="createMovie"	onsubmit="return validate();">

					<h1>
						<INPUT TYPE="hidden" NAME="id" value="">
					</h1>
					<H1 align="center">Create Movie</H1>
					<BR>
					<TABLE ALIGN="CENTER" width="400px">

						<TR>
							<TD><b>Movie Name</b></TD>
							<TD><INPUT TYPE="TEXT" NAME="movieName" id="moviename"
								value=""></TD>
						</TR>
						<TR>
							<TD><b>Banner</b></TD>
							<TD><INPUT TYPE="TEXT" NAME="movieBanner" id="movieBanner"
								value=""></TD>
						</TR>
						<TR>
							<TD><b>Release Date (yyyy-mm-dd)</b></TD>
							<TD><INPUT TYPE="TEXT" NAME="releaseDate" id="releaseDate"
								value=""></TD>
						</TR>
						<TR>
						<TR>
							<TD><b>Rent Amount</b></TD>
							<TD><INPUT TYPE="TEXT" NAME="rentAmount" id="rentAmount"
								value=""></TD>
						</TR>
						<TR>
						<TR>
							<TD><b>Categories</b></TD>
							<TD><select name="categories" >
									<option value="HORROR" selected="selected">HORROR</option>
									<option value="ACTION">ACTION</option>
									<option value="HINDI">HINDI</option>
									<option value="ENGLISH">ENGLISH</option>
									<option value="COMEDY">COMEDY</option>
									<option value="ROMANTIC">ROMANTIC</option>
								</select>
							</TD>
						</TR>
						<TR>
							<TD><b>Copies Available</b></TD>
							<TD><INPUT TYPE="TEXT" NAME="copiesAvailable" id="copiesAvailable" value="">
							</TD>
						</TR>

						<TR>
							<TD colspan=3 align="center"><INPUT TYPE="Submit"
								NAME="submit" VALUE="Create Movie"></TD>
						</TR>
					</TABLE>
				</FORM>



</table>
</td>
</tr> 	
</table>
</td>
</tr>
<%@ include file="/bottom.html" %>
</table>
</body>
</html>